// comm/views/hdModalView/hdModalView.js
import S_request from '../../utils/requestService.js';
import CONFIG from '../../config.js';
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    modalObj: {
      type: Object,
      value: null
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    modalObj: {}
  },

  /**
   * 组件的方法列表
   */
  methods: {
    returnEevet: function(e) {},

    onGotUserInfo: function(e) {
      console.log(e.detail.errMsg)
      console.log(e.detail.userInfo)
      console.log(e.detail.rawData)
      if (!e.detail.userInfo) return;
      app.globalData.userInfo = e.detail.userInfo;
      let userInfo = e.detail.userInfo;
      S_request.index.updateUserInfo(userInfo, (result) => {
        // console.log("更新与用户信息成功====" + JSON.stringify(result));
        app.globalData.goldnum = result.goldcoin;
      })
      this.triggerEvent('modalRightAc', e.detail.userInfo)
    }
  }
})